package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzPinglunMapper;
import com.ruoyi.system.domain.DzPinglun;
import com.ruoyi.system.service.IDzPinglunService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-01
 */
@Service
public class DzPinglunServiceImpl implements IDzPinglunService 
{
    @Autowired
    private DzPinglunMapper dzPinglunMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询评论
     * 
     * @param plId 评论主键
     * @return 评论
     */
    @Override
    public DzPinglun selectDzPinglunByPlId(Long plId)
    {
        return dzPinglunMapper.selectDzPinglunByPlId(plId);
    }

    /**
     * 查询评论列表
     * 
     * @param dzPinglun 评论
     * @return 评论
     */
    @Override
    public List<DzPinglun> selectDzPinglunList(DzPinglun dzPinglun)
    {

        return dzPinglunMapper.selectDzPinglunList(dzPinglun);
    }

    @Override
    public List<DzPinglun> selectDzPinglunListWeb(DzPinglun dzPinglun)
    {
        return dzPinglunMapper.selectDzPinglunList(dzPinglun);
    }

    /**
     * 新增评论
     * 
     * @param dzPinglun 评论
     * @return 结果
     */
    @Override
    public int insertDzPinglun(DzPinglun dzPinglun)
    {
        dzPinglun.setCreateTime(DateUtils.getNowDate());
        return dzPinglunMapper.insertDzPinglun(dzPinglun);
    }

    /**
     * 修改评论
     * 
     * @param dzPinglun 评论
     * @return 结果
     */
    @Override
    public int updateDzPinglun(DzPinglun dzPinglun)
    {
        return dzPinglunMapper.updateDzPinglun(dzPinglun);
    }

    /**
     * 批量删除评论
     * 
     * @param plIds 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteDzPinglunByPlIds(Long[] plIds)
    {
        return dzPinglunMapper.deleteDzPinglunByPlIds(plIds);
    }

    /**
     * 删除评论信息
     * 
     * @param plId 评论主键
     * @return 结果
     */
    @Override
    public int deleteDzPinglunByPlId(Long plId)
    {
        return dzPinglunMapper.deleteDzPinglunByPlId(plId);
    }
}
